<template>
  <view>
    <custom-navbar v-if="clientType === 'customer'" :title="listData?.title" />
    <FindJob v-if="clientType === 'customer'" />
    <Recruitment v-if="clientType === 'enterprise'" />
  </view>
</template>

<script setup lang="ts">
import FindJob from '@/pages/tab/list/findJob.vue';
import Recruitment from '@/pages/tab/list/recruitment.vue';
import { useUserStore } from '@/store';

const userStore = useUserStore();
const clientType = computed(() => userStore.clientType);
const listData = computed(() => {
  if (clientType.value === 'customer') {
    return {
      title: '找工作',
    };
  }
  if (clientType.value === 'enterprise') {
    return {
      title: '招人',
    };
  }
  return null;
});
onShow(() => {
  const { globalData } = getApp();
  globalData!.initTabbar(uni.$u.pages(), 1);
});
</script>
